package com.zbkj.common.model.traceability;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 追溯日志实体类
 * +----------------------------------------------------------------------
 * | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
 * +----------------------------------------------------------------------
 * | Author: xiaolic
 * +----------------------------------------------------------------------
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("zfb_traceability_logs")
@ApiModel(value="TraceabilityLogs对象", description="追溯日志信息")
public class TraceabilityLogs implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "日志主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "所属批次ID")
    private Long batchId;

    // 在TraceabilityLogs类中添加新字段
    @ApiModelProperty(value = "可追溯项ID")
    private Long traceableItemId;

    @ApiModelProperty(value = "日志标题")
    private String logTitle;

    @ApiModelProperty(value = "日志内容")
    private String logContent;

    @ApiModelProperty(value = "图片地址 (URL)，多个图片地址用英文逗号分隔")
    private String imageUrl;

    @ApiModelProperty(value = "日志事件发生时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date logTime;
    
    @ApiModelProperty(value = "排序字段，值越小越靠前")
    private Integer sortOrder;

    @ApiModelProperty(value = "是否删除：0-否，1-是")
    @TableLogic
    private Integer isDeleted;

    @ApiModelProperty(value = "日志记录创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdAt;

    @ApiModelProperty(value = "日志记录更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedAt;

    @ApiModelProperty(value = "经度")
    private String longitude;

    @ApiModelProperty(value = "纬度")
    private String latitude;

    @ApiModelProperty(value = "地名")
    private String place;

    @ApiModelProperty(value = "地址")
    private String address;

    @ApiModelProperty(value = "详细地址")
    private String details;
}
